Assignment #24 Age in 5 Years
Code
/// Name: Lacey Reese
/// Period: 5
/// Program Name: NameIn5Years
/// File Name: NameIn5Years.java
/// Date Finished 10/5/2015
import java.util.Scanner;
public class AgeInFiveYears
{
public static void main( String[] args )
{
Scanner Lacey= new Scanner(System.in);
String name;
int age;
System.out.println( "What's your name dude?" );
name=Lacey.next();
System.out.println( " Hi, " + name + "! How old are you?" );
age=Lacey.nextInt();
System.out.println( "In five years you will be " + ( age + 5) + " and five years ago you were " + ( age - 5) + "." );
}
}
Picture of the output
// idk why I said dude....lol